package com.ecoolex.ying.space.ws;

import com.ecoolex.framework.common.exception.BizException;
import com.ecoolex.framework.common.pojo.Page;
import com.ecoolex.framework.common.pojo.Pagination;
import com.ecoolex.framework.common.pojo.Sorting;
import com.ecoolex.ying.space.core.manager.MarktingCatalogGoodsManager;
import com.ecoolex.ying.space.entity.MarktingCatalogGoods;
import com.ecoolex.ying.space.entity.OutsourcingGoodsWithBLOBs;
import com.ecoolex.ying.space.pojo.AddMarktingCatalogGoodsDTO;
import com.ecoolex.ying.space.pojo.QueryMarktingCatalogGoodsDTO;

import java.util.List;

import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;


@Service
public class MarktingCatalogGoodsServiceImpl implements MarktingCatalogGoodsService {


    @Autowired
    private MarktingCatalogGoodsManager marktingCatalogGoodsManager;

    @Override
    public MarktingCatalogGoods addCatalogGoods(AddMarktingCatalogGoodsDTO record, String createUser) throws BizException {
        return marktingCatalogGoodsManager.add(record, createUser);
    }

    @Override
    public void deleteCatalogGoods(MarktingCatalogGoods record, String updateUser) throws BizException {
        marktingCatalogGoodsManager.delete(record, updateUser);
    }

    @Override
    public MarktingCatalogGoods getCatalogGoodsById(Integer catalogGoodsId) {
        return marktingCatalogGoodsManager.getCatalogGoodsById(catalogGoodsId);
    }

    @Override
    public Pagination<MarktingCatalogGoods> queryRelatedCatalogGoods(QueryMarktingCatalogGoodsDTO query, Sorting[] sorts, Page page) {
        return marktingCatalogGoodsManager.queryRelatedCatalogGoods(query, sorts, page);
    }

    @Override
    public Pagination<OutsourcingGoodsWithBLOBs> queryUnrelatedCatalogGoods(QueryMarktingCatalogGoodsDTO query, Sorting[] sorts, Page page) {
        return marktingCatalogGoodsManager.queryUnrelatedCatalogGoods(query, sorts, page);
    }

	@Override
	public long countCatalogGoodsByCatalogId(Integer catalogId) {
		return marktingCatalogGoodsManager.countCatalogGoodsByCatalogId(catalogId);
	}

	@Override
	public Pagination<MarktingCatalogGoods> queryMarktingCatalogGoodsByCatalogId(Integer catalogId, Page page) {
		return marktingCatalogGoodsManager.queryMarktingCatalogGoodsByCatalogId(catalogId, page);
	}

	@Override
	public MarktingCatalogGoods editGoods(MarktingCatalogGoods record, String updateUser) throws BizException {
		return marktingCatalogGoodsManager.editGoods(record, updateUser);
	}

	@Override
	public List<MarktingCatalogGoods> marktingCatalogGoodsList(Integer catalogId, int size) {
		return marktingCatalogGoodsManager.marktingCatalogGoodsList(catalogId, size);
	}

}
